﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading.Tasks;
using StyleMVVM.Data.Activation;
using StyleMVVM.Logging;
using StyleMVVM.Utilities;
using l4n = log4net;

namespace StyleMVVM.log4net
{
	public class LogService : ILogService
	{
		public ILog GetLogger(string loggerName)
		{
			if (loggerName == null)
			{
				loggerName = string.Empty;
			}

			l4n.ILog logger = l4n.LogManager.GetLogger(loggerName);

			return new LogImpl(logger);
		}

		/// <summary>
		/// If you want log4net configured at startup using XmlConfigurator.Configure set this as the activate method for the export
		/// </summary>
		public void Activate()
		{
			l4n.Config.XmlConfigurator.Configure();
		}
	}
}